From ec65c6d1ce8a5387016851646342d2ecc6fd7bbb Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 19 Nov 2015 20:26:11 +0100 Subject: [PATCH] wayland: Fix toplevel lookup before starting DnD We use the high-level gdk_device_get_window_at_position() to figure out the window, although this one actually tries to find out the current window under the device coordinates, which might well fall outside the window, so NULL is returned in those cases. Fix this by using the lower level _gdk_device_window_at_position() that will return the toplevel without further lookups, so is more desirable here. https://bugzilla.gnome.org/show_bug.cgi?id=758250 --- gdk/wayland/gdkdnd-wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index 835b6d08e2..6f95b076a9 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -25,6 +25,8 @@ #include "gdkprivate-wayland.h" #include "gdkdisplay-wayland.h" +#include "gdkdeviceprivate.h" + #include #define GDK_TYPE_WAYLAND_DRAG_CONTEXT (gdk_wayland_drag_context_get_type ()) @@ -350,7 +352,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window, GdkWindow *toplevel; GList *l; - toplevel = gdk_device_get_window_at_position (device, NULL, NULL); + toplevel = _gdk_device_window_at_position (device, NULL, NULL, NULL, TRUE); context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL); context = GDK_DRAG_CONTEXT (context_wayland); -- 2.30.2